home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / U-Z / VideoToolbox 4.95.sit / VideoToolbox / VideoToolboxSources / MoveMouse.c < prev    next >
MacBinary  |  1995-01-11  |  8.0 KB  |  [TEXT/MMCC]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Wed Jan 11 20:15:41 1995, modified Wed Jan 11 20:15:41 1995, creator 'MMCC', type ASCII, 7455 bytes "MoveMouse.c" , at 0x1d9f 502 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MMCC]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 4d 6f 76 65 4d 6f | 75 73 65 2e 63 00 00 00 |..MoveMo|use.c...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 4d 43 | 43 00 00 00 00 00 00 00 |.TEXTMMC|C.......|
|00000050| 00 00 00 00 00 1d 1f 00 | 00 01 f6 ab 3a 33 3d ab |........|....:3=.|
|00000060| 3a 33 3d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |:3=.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 dd 63 00 00 |........|.....c..|
|00000080| 2f 2a 0d 4d 6f 76 65 4d | 6f 75 73 65 2e 63 0d 0d |/*.MoveM|ouse.c..|
|00000090| 44 61 6e 20 53 65 61 72 | 73 20 28 73 65 61 72 73 |Dan Sear|s (sears|
|000000a0| 40 6e 65 74 63 6f 6d 2e | 63 6f 6d 29 20 77 72 69 |@netcom.|com) wri|
|000000b0| 74 65 73 2c 20 0d 22 54 | 68 65 20 41 70 70 6c 65 |tes, ."T|he Apple|
|000000c0| 20 66 69 6c 65 20 4d 6f | 76 65 4d 6f 75 73 65 2e | file Mo|veMouse.|
|000000d0| 63 20 69 73 20 62 61 73 | 65 64 20 6f 6e 20 73 6f |c is bas|ed on so|
|000000e0| 6d 65 20 63 6f 64 65 20 | 66 72 6f 6d 20 4a 6f 6e |me code |from Jon|
|000000f0| 20 57 74 74 65 20 61 6e | 64 20 69 74 20 75 73 65 | Wtte an|d it use|
|00000100| 73 20 74 68 65 0d 43 75 | 72 73 6f 72 20 44 65 76 |s the.Cu|rsor Dev|
|00000110| 69 63 65 20 4d 61 6e 61 | 67 65 72 2e 20 20 59 6f |ice Mana|ger. Yo|
|00000120| 75 20 73 68 6f 75 6c 64 | 20 72 65 61 64 20 74 68 |u should| read th|
|00000130| 65 20 74 65 63 68 20 6e | 6f 74 65 20 74 68 61 74 |e tech n|ote that|
|00000140| 20 64 65 73 63 72 69 62 | 65 73 20 74 68 65 0d 41 | describ|es the.A|
|00000150| 50 49 20 66 6f 72 20 74 | 68 69 73 20 6d 61 6e 61 |PI for t|his mana|
|00000160| 67 65 72 2c 20 22 48 57 | 20 30 31 20 2d 20 41 44 |ger, "HW| 01 - AD|
|00000170| 42 20 28 54 68 65 20 55 | 6e 74 6f 6c 64 20 53 74 |B (The U|ntold St|
|00000180| 6f 72 79 3a 20 53 70 61 | 63 65 20 41 6c 69 65 6e |ory: Spa|ce Alien|
|00000190| 73 20 61 74 65 20 6d 79 | 0d 6d 6f 75 73 65 29 22 |s ate my|.mouse)"|
|000001a0| 2e 20 0d 0d 54 68 69 73 | 20 69 73 20 66 72 6f 6d |. ..This| is from|
|000001b0| 20 41 70 70 6c 65 2e 20 | 49 74 20 6d 61 79 20 62 | Apple. |It may b|
|000001c0| 65 20 75 73 65 66 75 6c | 20 74 6f 20 70 65 6f 70 |e useful| to peop|
|000001d0| 6c 65 20 77 68 6f 20 6e | 65 65 64 20 61 6e 20 65 |le who n|eed an e|
|000001e0| 71 75 69 76 61 6c 65 6e | 74 20 74 6f 0d 53 65 74 |quivalen|t to.Set|
|000001f0| 4d 6f 75 73 65 2e 63 20 | 74 68 61 74 20 77 6f 72 |Mouse.c |that wor|
|00000200| 6b 73 20 6f 6e 20 41 4c | 4c 20 4d 61 63 73 2e 20 |ks on AL|L Macs. |
|00000210| 2d 20 64 67 70 2c 20 31 | 32 2f 39 34 0d 0d 4e 4f |- dgp, 1|2/94..NO|
|00000220| 54 45 3a 20 54 68 65 20 | 54 48 49 4e 4b 20 43 20 |TE: The |THINK C |
|00000230| 36 20 63 6f 6d 70 69 6c | 65 72 20 63 68 6f 6b 65 |6 compil|er choke|
|00000240| 64 20 6f 6e 20 6f 6e 65 | 20 6f 66 20 74 68 65 20 |d on one| of the |
|00000250| 28 6c 65 67 61 6c 29 20 | 72 65 63 75 72 73 69 76 |(legal) |recursiv|
|00000260| 65 20 73 74 72 75 63 74 | 75 72 65 0d 64 65 66 69 |e struct|ure.defi|
|00000270| 6e 69 74 69 6f 6e 73 20 | 69 6e 20 74 68 65 20 6f |nitions |in the o|
|00000280| 72 69 67 69 6e 61 6c 20 | 76 65 72 73 69 6f 6e 20 |riginal |version |
|00000290| 6f 66 20 74 68 69 73 20 | 66 69 6c 65 2e 20 28 54 |of this |file. (T|
|000002a0| 68 65 20 73 74 72 75 63 | 74 75 72 65 20 64 65 66 |he struc|ture def|
|000002b0| 69 6e 69 74 69 6f 6e 73 | 0d 61 72 65 20 6e 6f 77 |initions|.are now|
|000002c0| 20 61 6c 6c 20 69 6e 20 | 41 70 70 6c 65 27 73 20 | all in |Apple's |
|000002d0| 43 75 72 73 6f 72 44 65 | 76 69 63 65 73 2e 68 20 |CursorDe|vices.h |
|000002e0| 66 69 6c 65 2e 29 20 54 | 68 65 20 54 48 49 4e 4b |file.) T|he THINK|
|000002f0| 20 43 20 37 20 61 6e 64 | 20 43 6f 64 65 57 61 72 | C 7 and| CodeWar|
|00000300| 72 69 6f 72 0d 63 6f 6d | 70 69 6c 65 72 73 20 64 |rior.com|pilers d|
|00000310| 6f 6e 27 74 20 63 6f 6d | 70 6c 61 69 6e 2e 0d 0d |on't com|plain...|
|00000320| 46 72 6f 6d 20 41 70 70 | 6c 65 20 44 65 76 65 6c |From App|le Devel|
|00000330| 6f 70 65 72 20 53 65 72 | 76 69 63 65 73 3a 0d 0d |oper Ser|vices:..|
|00000340| 49 6e 20 74 68 65 20 70 | 61 73 74 2c 20 6d 6f 76 |In the p|ast, mov|
|00000350| 69 6e 67 20 74 68 65 20 | 63 75 72 73 6f 72 20 70 |ing the |cursor p|
|00000360| 72 6f 67 72 61 6d 61 74 | 69 63 61 6c 6c 79 20 6f |rogramat|ically o|
|00000370| 6e 20 74 68 65 20 4d 61 | 63 69 6e 74 6f 73 68 20 |n the Ma|cintosh |
|00000380| 68 61 73 0d 65 6e 74 61 | 69 6c 65 64 20 74 68 65 |has.enta|iled the|
|00000390| 20 6d 61 6e 69 70 75 6c | 61 74 69 6f 6e 20 6f 66 | manipul|ation of|
|000003a0| 20 6c 6f 77 20 6d 65 6d | 6f 72 79 20 67 6c 6f 62 | low mem|ory glob|
|000003b0| 61 6c 73 2e 20 54 68 69 | 73 20 68 61 73 20 77 6f |als. Thi|s has wo|
|000003c0| 72 6b 65 64 20 66 6f 72 | 0d 61 6c 6c 20 6d 61 63 |rked for|.all mac|
|000003d0| 73 20 66 6f 72 20 71 75 | 69 74 65 20 73 6f 6d 65 |s for qu|ite some|
|000003e0| 20 74 69 6d 65 2e 20 42 | 75 74 20 77 69 74 68 20 | time. B|ut with |
|000003f0| 74 68 65 20 61 64 76 65 | 6e 74 20 6f 66 20 74 68 |the adve|nt of th|
|00000400| 65 20 70 6f 77 65 72 20 | 62 6f 6f 6b 0d 73 65 72 |e power |book.ser|
|00000410| 69 65 73 20 61 6e 64 20 | 6d 61 6e 79 20 33 72 64 |ies and |many 3rd|
|00000420| 20 70 61 72 74 79 20 74 | 72 61 63 6b 20 62 61 6c | party t|rack bal|
|00000430| 6c 73 2c 20 69 74 20 68 | 61 73 20 62 65 63 6f 6d |ls, it h|as becom|
|00000440| 65 20 61 70 70 61 72 65 | 6e 74 20 74 68 61 74 20 |e appare|nt that |
|00000450| 74 68 65 0d 6c 6f 77 20 | 6d 65 6d 6f 72 79 20 67 |the.low |memory g|
|00000460| 6c 6f 62 61 6c 73 20 6e | 6f 20 6c 6f 6e 67 65 72 |lobals n|o longer|
|00000470| 20 63 6f 6e 74 61 69 6e | 65 64 20 61 64 65 71 75 | contain|ed adequ|
|00000480| 61 74 65 20 69 6e 66 6f | 72 6d 61 74 69 6f 6e 20 |ate info|rmation |
|00000490| 66 6f 72 20 74 68 65 0d | 73 79 73 74 65 6d 20 74 |for the.|system t|
|000004a0| 6f 20 74 72 75 6c 79 20 | 73 75 70 70 6f 72 74 20 |o truly |support |
|000004b0| 61 6c 6c 20 74 79 70 65 | 73 20 6f 66 20 70 6f 73 |all type|s of pos|
|000004c0| 69 74 69 6f 6e 69 6e 67 | 20 64 65 76 69 63 65 73 |itioning| devices|
|000004d0| 2e 20 53 6f 2c 20 77 69 | 74 68 20 74 68 65 0d 6e |. So, wi|th the.n|
|000004e0| 65 77 20 43 65 6e 74 72 | 69 73 20 43 50 55 27 73 |ew Centr|is CPU's|
|000004f0| 2c 20 61 6e 64 20 43 50 | 55 27 73 20 66 72 6f 6d |, and CP|U's from|
|00000500| 20 61 6c 6c 20 6c 69 6e | 65 73 20 61 66 74 65 72 | all lin|es after|
|00000510| 20 77 65 20 61 72 65 20 | 69 6d 70 6c 65 6d 65 6e | we are |implemen|
|00000520| 74 69 6e 67 20 61 0d 6e | 65 77 20 74 6f 6f 6c 20 |ting a.n|ew tool |
|00000530| 73 65 74 20 74 68 61 74 | 20 70 72 6f 76 69 64 65 |set that| provide|
|00000540| 73 20 61 20 6d 75 63 68 | 20 6d 6f 72 65 20 63 6f |s a much| more co|
|00000550| 6d 70 72 65 68 65 6e 73 | 69 76 65 20 73 65 74 20 |mprehens|ive set |
|00000560| 6f 66 20 75 74 69 6c 69 | 74 69 65 73 0d 66 6f 72 |of utili|ties.for|
|00000570| 20 64 65 61 6c 69 6e 67 | 20 77 69 74 68 20 74 68 | dealing| with th|
|00000580| 65 20 63 75 72 73 6f 72 | 20 6c 6f 63 61 74 69 6f |e cursor| locatio|
|00000590| 6e 20 61 6e 64 20 6d 6f | 75 73 65 20 62 75 74 74 |n and mo|use butt|
|000005a0| 6f 6e 20 73 74 61 74 65 | 2e 20 57 65 20 63 61 6c |on state|. We cal|
|000005b0| 6c 0d 74 68 69 73 20 6e | 65 77 20 6d 61 6e 61 67 |l.this n|ew manag|
|000005c0| 65 72 20 74 68 65 20 43 | 75 72 73 6f 72 20 44 65 |er the C|ursor De|
|000005d0| 76 69 63 65 20 4d 61 6e | 61 67 65 72 2c 20 61 6e |vice Man|ager, an|
|000005e0| 64 20 44 54 53 20 77 69 | 6c 6c 20 62 65 20 64 6f |d DTS wi|ll be do|
|000005f0| 63 75 6d 65 6e 74 69 6e | 67 0d 69 74 20 69 6e 20 |cumentin|g.it in |
|00000600| 61 20 66 75 74 75 72 65 | 20 74 65 63 68 20 6e 6f |a future| tech no|
|00000610| 74 2c 20 62 75 74 20 73 | 69 6e 63 65 20 6d 61 6e |t, but s|ince man|
|00000620| 79 20 6d 61 63 68 69 6e | 65 73 20 61 72 65 20 6e |y machin|es are n|
|00000630| 6f 77 20 73 68 69 70 70 | 69 6e 67 20 74 68 61 74 |ow shipp|ing that|
|00000640| 0d 64 6f 20 6e 6f 74 20 | 75 73 65 20 74 68 65 20 |.do not |use the |
|00000650| 74 72 61 64 69 74 69 6f | 6e 61 6c 20 6c 6f 77 20 |traditio|nal low |
|00000660| 6d 65 6d 6f 72 79 20 67 | 6c 6f 62 61 6c 73 20 74 |memory g|lobals t|
|00000670| 6f 20 67 65 74 20 74 68 | 65 20 6d 6f 75 73 65 20 |o get th|e mouse |
|00000680| 6c 6f 63 61 74 69 6f 6e | 0d 61 6e 64 20 70 6f 73 |location|.and pos|
|00000690| 69 74 69 6f 6e 20 74 68 | 65 20 6d 6f 75 73 65 2c |ition th|e mouse,|
|000006a0| 20 69 74 20 69 73 20 69 | 6d 70 6f 72 74 61 6e 74 | it is i|mportant|
|000006b0| 20 74 6f 20 22 6c 65 61 | 6b 22 20 61 20 6c 69 74 | to "lea|k" a lit|
|000006c0| 74 6c 65 20 6f 66 20 74 | 68 65 20 74 65 63 68 0d |tle of t|he tech.|
|000006d0| 6e 6f 74 65 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e |note inf|ormation|
|000006e0| 20 65 61 72 6c 79 2e 0d | 0d 46 69 72 73 74 2c 20 | early..|.First, |
|000006f0| 74 68 65 20 43 44 4d 20 | 28 43 75 72 73 6f 72 20 |the CDM |(Cursor |
|00000700| 64 65 76 69 63 65 20 6d | 61 6e 61 67 65 72 29 20 |device m|anager) |
|00000710| 68 61 73 20 69 74 73 20 | 6f 77 6e 20 74 72 61 70 |has its |own trap|
|00000720| 20 28 24 41 41 44 42 29 | 20 61 6e 64 20 79 6f 75 | ($AADB)| and you|
|00000730| 0d 63 61 6e 20 64 65 74 | 65 72 6d 69 6e 65 20 69 |.can det|ermine i|
|00000740| 66 20 61 20 6d 61 63 68 | 69 6e 65 20 73 75 70 70 |f a mach|ine supp|
|00000750| 6f 72 74 73 20 74 68 65 | 20 43 44 4d 20 62 79 20 |orts the| CDM by |
|00000760| 75 73 69 6e 67 20 74 68 | 65 20 73 74 61 6e 64 61 |using th|e standa|
|00000770| 72 64 20 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |rd TrapA|vailable|
|00000780| 0d 72 6f 75 74 69 6e 65 | 2e 20 28 53 65 65 20 69 |.routine|. (See i|
|00000790| 6e 73 69 64 65 20 6d 61 | 63 20 66 6f 72 20 74 68 |nside ma|c for th|
|000007a0| 65 20 73 6f 75 72 63 65 | 20 63 6f 64 65 20 74 6f |e source| code to|
|000007b0| 20 54 72 61 70 0d 41 76 | 61 69 6c 61 62 6c 65 29 | Trap.Av|ailable)|
|000007c0| 2e 20 4f 6e 63 65 20 79 | 6f 75 20 68 61 76 65 20 |. Once y|ou have |
|000007d0| 64 65 74 65 72 6d 69 6e | 65 64 20 74 68 61 74 20 |determin|ed that |
|000007e0| 74 68 65 20 43 44 4d 20 | 65 78 69 73 74 73 2c 20 |the CDM |exists, |
|000007f0| 79 6f 75 20 73 68 6f 75 | 6c 64 0d 74 72 79 20 6e |you shou|ld.try n|
|00000800| 6f 74 20 74 6f 20 75 73 | 65 20 74 68 65 20 6c 6f |ot to us|e the lo|
|00000810| 77 20 6d 65 6d 6f 72 79 | 20 67 6c 6f 62 61 6c 73 |w memory| globals|
|00000820| 20 52 61 77 4d 6f 75 73 | 65 20 61 6e 64 20 4d 54 | RawMous|e and MT|
|00000830| 65 6d 70 20 74 6f 20 67 | 65 74 20 74 68 65 0d 63 |emp to g|et the.c|
|00000840| 75 72 72 65 6e 74 20 63 | 75 72 73 6f 72 20 6c 6f |urrent c|ursor lo|
|00000850| 63 61 74 69 6f 6e 2c 20 | 6f 72 20 73 65 74 20 61 |cation, |or set a|
|00000860| 20 6e 65 77 20 63 75 72 | 73 6f 72 20 6c 6f 63 61 | new cur|sor loca|
|00000870| 74 69 6f 6e 2e 20 49 6e | 73 74 65 61 64 20 74 68 |tion. In|stead th|
|00000880| 65 20 43 44 4d 0d 70 72 | 6f 76 69 64 65 73 20 33 |e CDM.pr|ovides 3|
|00000890| 20 63 61 6c 6c 73 20 77 | 68 69 63 68 20 79 6f 75 | calls w|hich you|
|000008a0| 20 63 61 6e 20 75 73 65 | 20 74 6f 20 67 65 74 20 | can use| to get |
|000008b0| 74 68 69 73 20 69 6e 66 | 6f 2c 20 74 68 65 20 66 |this inf|o, the f|
|000008c0| 69 72 73 74 20 69 73 0d | 43 72 73 72 44 65 76 4e |irst is.|CrsrDevN|
|000008d0| 65 78 74 44 65 76 69 63 | 65 20 77 68 69 63 68 20 |extDevic|e which |
|000008e0| 77 69 6c 6c 20 67 69 76 | 65 20 79 6f 75 20 74 68 |will giv|e you th|
|000008f0| 65 20 6e 65 78 74 20 63 | 75 72 73 6f 72 20 64 65 |e next c|ursor de|
|00000900| 76 69 63 65 20 72 65 63 | 6f 72 64 20 69 6e 0d 74 |vice rec|ord in.t|
|00000910| 68 65 20 43 44 4d 20 6c | 69 73 74 2c 20 69 66 20 |he CDM l|ist, if |
|00000920| 79 6f 75 20 70 61 73 73 | 20 69 74 20 61 20 4e 55 |you pass| it a NU|
|00000930| 4c 4c 2c 20 69 74 20 77 | 69 6c 6c 20 67 69 76 65 |LL, it w|ill give|
|00000940| 20 79 6f 75 20 74 68 65 | 20 68 65 61 64 20 6f 66 | you the| head of|
|00000950| 20 74 68 65 0d 6c 69 73 | 74 2e 20 4f 6e 63 65 20 | the.lis|t. Once |
|00000960| 79 6f 75 20 68 61 76 65 | 20 74 68 65 20 66 69 72 |you have| the fir|
|00000970| 73 74 20 63 75 72 73 6f | 72 20 64 65 76 69 63 65 |st curso|r device|
|00000980| 20 79 6f 75 20 63 61 6e | 20 75 73 65 20 69 74 20 | you can| use it |
|00000990| 74 6f 20 67 65 74 20 74 | 68 65 0d 43 75 72 73 6f |to get t|he.Curso|
|000009a0| 72 20 64 61 74 61 20 72 | 65 63 6f 72 64 20 77 68 |r data r|ecord wh|
|000009b0| 69 63 68 20 63 6f 6e 74 | 61 69 6e 73 20 74 68 65 |ich cont|ains the|
|000009c0| 20 63 75 72 72 65 6e 74 | 20 63 75 72 73 6f 72 20 | current| cursor |
|000009d0| 6c 6f 63 61 74 69 6f 6e | 20 69 6e 20 69 74 73 0d |location| in its.|
|000009e0| 77 68 65 72 65 20 66 69 | 65 6c 64 2e 20 59 6f 75 |where fi|eld. You|
|000009f0| 20 63 61 6e 20 73 65 74 | 20 74 68 65 20 63 75 72 | can set| the cur|
|00000a00| 72 65 6e 74 20 6c 6f 63 | 61 74 69 6f 6e 20 77 69 |rent loc|ation wi|
|00000a10| 74 68 20 65 69 74 68 65 | 72 20 74 68 65 0d 43 72 |th eithe|r the.Cr|
|00000a20| 73 72 44 65 76 4d 6f 76 | 65 20 28 77 68 69 63 68 |srDevMov|e (which|
|00000a30| 20 6d 6f 76 65 73 20 72 | 65 6c 61 74 69 76 65 20 | moves r|elative |
|00000a40| 74 6f 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 6c |to the c|urrent l|
|00000a50| 6f 63 61 74 69 6f 6e 29 | 20 6f 72 20 74 68 65 0d |ocation)| or the.|
|00000a60| 43 72 73 72 44 65 76 4d | 6f 76 65 54 6f 20 28 77 |CrsrDevM|oveTo (w|
|00000a70| 68 69 63 68 20 6d 6f 76 | 65 73 20 74 6f 20 61 6e |hich mov|es to an|
|00000a80| 20 61 62 73 6f 6c 75 74 | 65 20 6c 6f 63 61 74 69 | absolut|e locati|
|00000a90| 6f 6e 29 20 72 6f 75 74 | 69 6e 65 73 2e 0d 0d 54 |on) rout|ines...T|
|00000aa0| 68 65 20 66 6f 6c 6c 6f | 77 69 6e 67 20 69 73 20 |he follo|wing is |
|00000ab0| 73 6f 6d 65 20 73 61 6d | 70 6c 65 20 63 6f 64 65 |some sam|ple code|
|00000ac0| 20 77 68 69 63 68 20 69 | 6d 70 6c 65 6d 65 6e 74 | which i|mplement|
|00000ad0| 20 73 6f 6d 65 20 67 65 | 6e 65 72 69 63 20 72 6f | some ge|neric ro|
|00000ae0| 75 74 69 6e 65 73 0d 74 | 68 61 74 20 77 6f 72 6b |utines.t|hat work|
|00000af0| 20 6f 6e 20 61 6c 6c 20 | 6d 61 63 69 6e 74 6f 73 | on all |macintos|
|00000b00| 68 65 73 2e 20 54 68 65 | 73 65 20 72 6f 75 74 69 |hes. The|se routi|
|00000b10| 6e 65 73 20 61 72 65 20 | 77 72 69 74 74 65 6e 20 |nes are |written |
|00000b20| 6e 6f 74 20 66 6f 72 20 | 73 70 65 65 64 0d 62 75 |not for |speed.bu|
|00000b30| 74 20 66 6f 72 20 63 6c | 61 72 69 74 79 2c 20 73 |t for cl|arity, s|
|00000b40| 6f 20 69 66 20 79 6f 75 | 20 61 72 65 20 77 72 69 |o if you| are wri|
|00000b50| 74 69 6e 67 20 61 20 64 | 65 76 69 63 65 20 64 72 |ting a d|evice dr|
|00000b60| 69 76 65 72 20 6f 72 20 | 74 69 6d 65 20 63 72 69 |iver or |time cri|
|00000b70| 74 69 63 61 6c 0d 63 6f | 64 65 20 74 68 65 72 65 |tical.co|de there|
|00000b80| 20 61 72 65 20 73 6f 6d | 65 20 74 68 69 6e 67 73 | are som|e things|
|00000b90| 20 74 68 61 74 20 79 6f | 75 20 63 61 6e 20 64 6f | that yo|u can do|
|00000ba0| 20 74 6f 20 73 70 65 65 | 64 20 75 70 20 74 68 65 | to spee|d up the|
|00000bb0| 73 65 20 72 6f 75 74 69 | 6e 65 73 2c 0d 6c 69 6b |se routi|nes,.lik|
|00000bc0| 65 20 70 72 65 64 65 74 | 65 72 6d 69 6e 65 20 61 |e predet|ermine a|
|00000bd0| 74 20 74 68 65 20 6f 75 | 74 73 65 74 20 69 66 20 |t the ou|tset if |
|00000be0| 74 68 65 20 43 44 4d 20 | 65 78 69 73 74 73 2c 20 |the CDM |exists, |
|00000bf0| 74 68 69 73 20 77 61 79 | 20 79 6f 75 0d 77 6f 75 |this way| you.wou|
|00000c00| 6c 64 6e 27 74 20 68 61 | 76 65 20 74 6f 20 63 68 |ldn't ha|ve to ch|
|00000c10| 65 63 6b 20 65 76 65 72 | 79 20 74 69 6d 65 20 79 |eck ever|y time y|
|00000c20| 6f 75 20 77 61 6e 74 20 | 74 6f 20 75 73 65 20 69 |ou want |to use i|
|00000c30| 74 2c 20 61 6e 64 20 67 | 65 74 74 69 6e 67 20 74 |t, and g|etting t|
|00000c40| 68 65 0d 63 75 72 73 6f | 72 20 64 65 76 69 63 65 |he.curso|r device|
|00000c50| 20 6f 6e 6c 79 20 6f 6e | 63 65 20 61 6e 64 20 6b | only on|ce and k|
|00000c60| 65 65 70 69 6e 67 20 74 | 68 65 20 70 6f 69 6e 74 |eeping t|he point|
|00000c70| 65 72 20 74 6f 20 69 74 | 20 61 72 6f 75 6e 64 20 |er to it| around |
|00000c80| 62 65 74 77 65 65 6e 0d | 63 61 6c 6c 73 2e 0d 0d |between.|calls...|
|00000c90| 41 6e 79 77 61 79 2c 20 | 68 65 72 65 20 69 73 20 |Anyway, |here is |
|00000ca0| 73 6f 6d 65 20 73 61 6d | 70 6c 65 20 63 6f 64 65 |some sam|ple code|
|00000cb0| 20 74 68 61 74 20 6d 6f | 76 65 73 20 74 68 65 20 | that mo|ves the |
|00000cc0| 6d 6f 75 73 65 20 64 69 | 61 67 6f 6e 61 6c 6c 79 |mouse di|agonally|
|00000cd0| 20 75 6e 74 69 6c 0d 74 | 68 65 20 6d 6f 75 73 65 | until.t|he mouse|
|00000ce0| 20 62 75 74 74 6f 6e 20 | 69 73 20 70 72 65 73 73 | button |is press|
|00000cf0| 65 64 2e 20 46 6f 72 20 | 61 20 66 75 72 74 68 65 |ed. For |a furthe|
|00000d00| 72 20 65 78 70 6c 61 6e | 61 74 69 6f 6e 20 6f 66 |r explan|ation of|
|00000d10| 20 68 6f 77 20 74 68 65 | 20 6f 6c 64 65 72 0d 6c | how the| older.l|
|00000d20| 6f 77 20 6d 65 6d 6f 72 | 79 20 67 6c 6f 62 61 6c |ow memor|y global|
|00000d30| 20 6d 65 74 68 6f 64 20 | 77 6f 72 6b 73 2c 20 73 | method |works, s|
|00000d40| 65 65 20 74 68 65 20 64 | 65 76 65 6c 6f 70 65 72 |ee the d|eveloper|
|00000d50| 20 73 75 70 70 6f 72 74 | 20 74 65 63 68 20 69 6e | support| tech in|
|00000d60| 66 6f 0d 64 61 74 61 62 | 61 73 65 20 6f 6e 20 41 |fo.datab|ase on A|
|00000d70| 70 70 6c 65 4c 69 6e 6b | 2e 0d 0d 48 49 53 54 4f |ppleLink|...HISTO|
|00000d80| 52 59 3a 0d 38 2f 39 34 | 20 64 67 70 20 44 6f 77 |RY:.8/94| dgp Dow|
|00000d90| 6e 6c 6f 61 64 65 64 20 | 66 72 6f 6d 20 66 74 70 |nloaded |from ftp|
|00000da0| 3a 2f 2f 6e 61 64 61 2e | 6b 74 68 2e 73 65 2f 70 |://nada.|kth.se/p|
|00000db0| 75 62 2f 68 61 63 6b 73 | 2f 6d 61 63 2d 66 61 71 |ub/hacks|/mac-faq|
|00000dc0| 2f 4d 6f 76 65 4d 6f 75 | 73 65 2e 63 0d 31 30 2f |/MoveMou|se.c.10/|
|00000dd0| 39 34 20 64 67 70 20 6d | 61 64 65 20 6d 69 6e 69 |94 dgp m|ade mini|
|00000de0| 6d 61 6c 20 63 68 61 6e | 67 65 73 20 73 6f 20 74 |mal chan|ges so t|
|00000df0| 68 61 74 20 69 74 20 77 | 6f 75 6c 64 20 63 6f 6d |hat it w|ould com|
|00000e00| 70 69 6c 65 20 69 6e 20 | 43 6f 64 65 57 61 72 72 |pile in |CodeWarr|
|00000e10| 69 6f 72 20 43 2e 20 55 | 6e 74 65 73 74 65 64 2e |ior C. U|ntested.|
|00000e20| 0d 31 32 2f 39 34 20 64 | 67 70 20 75 70 64 61 74 |.12/94 d|gp updat|
|00000e30| 65 64 20 66 6f 72 20 63 | 6f 6d 70 61 74 69 62 69 |ed for c|ompatibi|
|00000e40| 6c 69 74 79 20 77 69 74 | 68 20 55 6e 69 76 65 72 |lity wit|h Univer|
|00000e50| 73 61 6c 20 48 65 61 64 | 65 72 20 22 43 75 72 73 |sal Head|er "Curs|
|00000e60| 6f 72 44 65 76 69 63 65 | 73 2e 68 22 2e 20 55 6e |orDevice|s.h". Un|
|00000e70| 74 65 73 74 65 64 2e 0d | 31 2f 35 2f 39 35 20 64 |tested..|1/5/95 d|
|00000e80| 67 70 20 75 70 64 61 74 | 65 64 20 66 6f 72 20 63 |gp updat|ed for c|
|00000e90| 6f 6d 70 61 74 69 62 6c | 69 74 79 20 77 69 74 68 |ompatibl|ity with|
|00000ea0| 20 55 6e 69 76 65 72 73 | 61 6c 20 48 65 61 64 65 | Univers|al Heade|
|00000eb0| 72 73 20 32 2c 20 69 6e | 20 77 68 69 63 68 20 43 |rs 2, in| which C|
|00000ec0| 75 72 73 6f 72 44 65 76 | 69 63 65 73 2e 68 20 77 |ursorDev|ices.h w|
|00000ed0| 61 73 0d 65 78 74 65 6e | 73 69 76 65 6c 79 20 63 |as.exten|sively c|
|00000ee0| 68 61 6e 67 65 64 2e 20 | 55 6e 74 65 73 74 65 64 |hanged. |Untested|
|00000ef0| 2e 0d 2a 2f 0d 0d 23 69 | 6e 63 6c 75 64 65 20 22 |..*/..#i|nclude "|
|00000f00| 56 69 64 65 6f 54 6f 6f | 6c 62 6f 78 2e 68 22 09 |VideoToo|lbox.h".|
|00000f10| 2f 2f 20 54 72 61 70 41 | 76 61 69 6c 61 62 6c 65 |// TrapA|vailable|
|00000f20| 0d 23 69 66 20 21 55 4e | 49 56 45 52 53 41 4c 5f |.#if !UN|IVERSAL_|
|00000f30| 48 45 41 44 45 52 53 0d | 09 23 65 72 72 6f 72 20 |HEADERS.|.#error |
|00000f40| 22 53 6f 72 72 79 2c 20 | 74 68 69 73 20 66 69 6c |"Sorry, |this fil|
|00000f50| 65 20 63 61 6e 6e 6f 74 | 20 62 65 20 63 6f 6d 70 |e cannot| be comp|
|00000f60| 69 6c 65 64 20 77 69 74 | 68 6f 75 74 20 41 70 70 |iled wit|hout App|
|00000f70| 6c 65 27 73 20 55 6e 69 | 76 65 72 73 61 6c 20 48 |le's Uni|versal H|
|00000f80| 65 61 64 65 72 20 66 69 | 6c 65 73 2c 20 70 72 65 |eader fi|les, pre|
|00000f90| 66 65 72 61 62 6c 79 20 | 76 2e 20 32 22 0d 23 65 |ferably |v. 2".#e|
|00000fa0| 6e 64 69 66 0d 23 69 6e | 63 6c 75 64 65 20 3c 43 |ndif.#in|clude <C|
|00000fb0| 75 72 73 6f 72 44 65 76 | 69 63 65 73 2e 68 3e 0d |ursorDev|ices.h>.|
|00000fc0| 23 64 65 66 69 6e 65 20 | 5f 43 75 72 73 6f 72 44 |#define |_CursorD|
|00000fd0| 65 76 69 63 65 44 69 73 | 70 61 74 63 68 20 30 78 |eviceDis|patch 0x|
|00000fe0| 41 41 44 42 20 2f 2f 20 | 6e 65 77 20 63 75 72 73 |AADB // |new curs|
|00000ff0| 6f 72 20 64 65 76 69 63 | 65 20 6d 61 6e 61 67 65 |or devic|e manage|
|00001000| 72 20 74 72 61 70 20 0d | 23 69 66 20 5f 5f 70 6f |r trap .|#if __po|
|00001010| 77 65 72 63 0d 09 23 64 | 65 66 69 6e 65 20 43 61 |werc..#d|efine Ca|
|00001020| 6c 6c 43 75 72 73 6f 72 | 54 61 73 6b 28 29 09 2f |llCursor|Task()./|
|00001030| 2f 20 6e 6f 74 20 6e 65 | 65 64 65 64 20 6f 6e 20 |/ not ne|eded on |
|00001040| 70 6f 77 65 72 70 63 2c | 20 73 6f 20 67 69 76 65 |powerpc,| so give|
|00001050| 20 65 6d 70 74 79 20 64 | 65 66 69 6e 69 74 69 6f | empty d|efinitio|
|00001060| 6e 0d 23 65 6c 73 65 0d | 09 70 61 73 63 61 6c 20 |n.#else.|.pascal |
|00001070| 76 6f 69 64 20 43 61 6c | 6c 43 75 72 73 6f 72 54 |void Cal|lCursorT|
|00001080| 61 73 6b 28 76 6f 69 64 | 29 20 3d 20 7b 30 78 32 |ask(void|) = {0x2|
|00001090| 30 37 38 2c 30 78 30 38 | 45 45 2c 30 78 34 45 39 |078,0x08|EE,0x4E9|
|000010a0| 30 7d 3b 0d 09 2f 2a 0d | 09 09 4d 4f 56 45 2e 4c |0};../*.|..MOVE.L|
|000010b0| 20 6a 43 72 73 72 54 61 | 73 6b 2c 41 30 0d 09 09 | jCrsrTa|sk,A0...|
|000010c0| 4a 53 52 20 28 41 30 29 | 0d 09 2a 2f 0d 23 65 6e |JSR (A0)|..*/.#en|
|000010d0| 64 69 66 0d 2f 2f 20 4f | 6c 64 20 73 74 79 6c 65 |dif.// O|ld style|
|000010e0| 20 6d 6f 75 73 65 20 6d | 6f 76 69 6e 67 20 65 71 | mouse m|oving eq|
|000010f0| 75 61 74 65 73 20 66 6f | 72 20 74 68 65 20 6c 6f |uates fo|r the lo|
|00001100| 77 20 6d 65 6d 6f 72 79 | 20 67 6c 6f 62 61 6c 73 |w memory| globals|
|00001110| 0d 23 64 65 66 69 6e 65 | 20 78 52 61 77 4d 6f 75 |.#define| xRawMou|
|00001120| 73 65 20 30 78 30 38 32 | 43 09 2f 2f 20 6c 6f 77 |se 0x082|C.// low|
|00001130| 20 6d 65 6d 6f 72 79 20 | 67 6c 6f 62 61 6c 20 74 | memory |global t|
|00001140| 68 61 74 20 68 61 73 20 | 63 75 72 72 65 6e 74 20 |hat has |current |
|00001150| 6d 6f 75 73 65 20 6c 6f | 63 0d 23 64 65 66 69 6e |mouse lo|c.#defin|
|00001160| 65 20 78 4d 54 65 6d 70 | 20 30 78 30 38 32 38 20 |e xMTemp| 0x0828 |
|00001170| 2f 2f 20 6c 6f 77 20 6d | 65 6d 6f 72 79 20 67 6c |// low m|emory gl|
|00001180| 6f 62 61 6c 20 74 68 61 | 74 20 68 61 73 20 63 75 |obal tha|t has cu|
|00001190| 72 72 65 6e 74 20 6d 6f | 75 73 65 20 6c 6f 63 0d |rrent mo|use loc.|
|000011a0| 23 64 65 66 69 6e 65 20 | 78 43 72 73 72 4e 65 77 |#define |xCrsrNew|
|000011b0| 20 30 78 30 38 43 45 20 | 2f 2f 20 73 65 74 20 61 | 0x08CE |// set a|
|000011c0| 66 74 65 72 20 79 6f 75 | 20 63 68 61 6e 67 65 20 |fter you| change |
|000011d0| 6d 74 65 6d 70 20 61 6e | 64 20 72 61 77 6d 6f 75 |mtemp an|d rawmou|
|000011e0| 73 65 0d 23 64 65 66 69 | 6e 65 20 78 43 72 73 72 |se.#defi|ne xCrsr|
|000011f0| 43 6f 75 70 6c 65 20 30 | 78 30 38 43 46 20 2f 2f |Couple 0|x08CF //|
|00001200| 20 74 72 75 65 20 69 66 | 20 74 68 65 20 63 75 72 | true if| the cur|
|00001210| 73 6f 72 20 69 73 20 74 | 69 65 64 20 74 6f 20 74 |sor is t|ied to t|
|00001220| 68 65 20 6d 6f 75 73 65 | 0d 0d 76 6f 69 64 20 47 |he mouse|..void G|
|00001230| 65 74 4d 6f 75 73 65 44 | 65 76 69 63 65 50 6f 73 |etMouseD|evicePos|
|00001240| 69 74 69 6f 6e 28 50 6f | 69 6e 74 20 2a 63 75 72 |ition(Po|int *cur|
|00001250| 72 65 6e 74 50 6f 69 6e | 74 29 3b 0d 76 6f 69 64 |rentPoin|t);.void|
|00001260| 20 53 65 74 4d 6f 75 73 | 65 44 65 76 69 63 65 50 | SetMous|eDeviceP|
|00001270| 6f 73 69 74 69 6f 6e 28 | 50 6f 69 6e 74 20 6e 65 |osition(|Point ne|
|00001280| 77 50 6f 69 6e 74 29 3b | 0d 76 6f 69 64 20 53 65 |wPoint);|.void Se|
|00001290| 74 4d 6f 75 73 65 44 65 | 76 69 63 65 50 6f 73 69 |tMouseDe|vicePosi|
|000012a0| 74 69 6f 6e 52 65 6c 28 | 50 6f 69 6e 74 20 6e 65 |tionRel(|Point ne|
|000012b0| 77 50 6f 69 6e 74 29 3b | 0d 76 6f 69 64 20 46 75 |wPoint);|.void Fu|
|000012c0| 64 67 65 43 75 72 73 6f | 72 28 76 6f 69 64 29 3b |dgeCurso|r(void);|
|000012d0| 0d 0d 23 69 66 20 21 64 | 65 66 69 6e 65 64 28 55 |..#if !d|efined(U|
|000012e0| 4e 49 56 45 52 53 41 4c | 5f 48 45 41 44 45 52 53 |NIVERSAL|_HEADERS|
|000012f0| 29 20 7c 7c 20 55 4e 49 | 56 45 52 53 41 4c 5f 48 |) || UNI|VERSAL_H|
|00001300| 45 41 44 45 52 53 3c 32 | 0d 09 23 64 65 66 69 6e |EADERS<2|..#defin|
|00001310| 65 20 43 75 72 73 6f 72 | 44 65 76 69 63 65 20 43 |e Cursor|Device C|
|00001320| 72 73 72 44 65 76 69 63 | 65 0d 09 23 64 65 66 69 |rsrDevic|e..#defi|
|00001330| 6e 65 20 43 75 72 73 6f | 72 44 65 76 69 63 65 4e |ne Curso|rDeviceN|
|00001340| 65 78 74 44 65 76 69 63 | 65 20 43 72 73 72 44 65 |extDevic|e CrsrDe|
|00001350| 76 4e 65 78 74 44 65 76 | 69 63 65 0d 09 23 64 65 |vNextDev|ice..#de|
|00001360| 66 69 6e 65 20 43 75 72 | 73 6f 72 44 65 76 69 63 |fine Cur|sorDevic|
|00001370| 65 4d 6f 76 65 20 43 72 | 73 72 44 65 76 4d 6f 76 |eMove Cr|srDevMov|
|00001380| 65 0d 09 23 64 65 66 69 | 6e 65 20 43 75 72 73 6f |e..#defi|ne Curso|
|00001390| 72 44 65 76 69 63 65 4d | 6f 76 65 54 6f 20 43 72 |rDeviceM|oveTo Cr|
|000013a0| 73 72 44 65 76 4d 6f 76 | 65 54 6f 0d 23 65 6e 64 |srDevMov|eTo.#end|
|000013b0| 69 66 0d 0d 76 6f 69 64 | 20 47 65 74 4d 6f 75 73 |if..void| GetMous|
|000013c0| 65 44 65 76 69 63 65 50 | 6f 73 69 74 69 6f 6e 28 |eDeviceP|osition(|
|000013d0| 50 6f 69 6e 74 20 2a 63 | 75 72 72 65 6e 74 50 6f |Point *c|urrentPo|
|000013e0| 69 6e 74 29 0d 7b 0d 09 | 2f 2f 20 54 68 69 73 20 |int).{..|// This |
|000013f0| 72 6f 75 74 69 6e 65 20 | 72 65 74 75 72 6e 73 20 |routine |returns |
|00001400| 74 68 65 20 63 75 72 72 | 65 6e 74 20 63 75 72 73 |the curr|ent curs|
|00001410| 6f 72 20 6c 6f 63 61 74 | 69 6f 6e 0d 09 43 75 72 |or locat|ion..Cur|
|00001420| 73 6f 72 44 65 76 69 63 | 65 20 2a 66 69 72 73 74 |sorDevic|e *first|
|00001430| 4d 6f 75 73 65 3b 0d 09 | 69 66 20 28 54 72 61 70 |Mouse;..|if (Trap|
|00001440| 41 76 61 69 6c 61 62 6c | 65 28 5f 43 75 72 73 6f |Availabl|e(_Curso|
|00001450| 72 44 65 76 69 63 65 44 | 69 73 70 61 74 63 68 29 |rDeviceD|ispatch)|
|00001460| 29 20 7b 20 0d 09 09 2f | 2f 20 49 66 20 77 65 20 |) { .../|/ If we |
|00001470| 67 65 74 20 68 65 72 65 | 20 77 65 20 68 61 76 65 |get here| we have|
|00001480| 20 74 68 65 20 43 44 4d | 0d 09 09 66 69 72 73 74 | the CDM|...first|
|00001490| 4d 6f 75 73 65 20 3d 20 | 4e 55 4c 4c 3b 09 2f 2f |Mouse = |NULL;.//|
|000014a0| 20 73 74 61 72 74 20 61 | 74 20 68 65 61 64 20 6f | start a|t head o|
|000014b0| 66 20 63 75 72 73 6f 72 | 20 64 65 76 20 6c 69 73 |f cursor| dev lis|
|000014c0| 74 0d 09 09 43 75 72 73 | 6f 72 44 65 76 69 63 65 |t...Curs|orDevice|
|000014d0| 4e 65 78 74 44 65 76 69 | 63 65 28 26 66 69 72 73 |NextDevi|ce(&firs|
|000014e0| 74 4d 6f 75 73 65 29 3b | 09 2f 2f 20 67 65 74 20 |tMouse);|.// get |
|000014f0| 74 68 65 20 6e 65 78 74 | 20 63 75 72 73 6f 72 20 |the next| cursor |
|00001500| 64 65 76 69 63 65 0d 09 | 09 2f 2f 20 4e 6f 77 20 |device..|.// Now |
|00001510| 67 65 74 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |get the |current |
|00001520| 63 75 72 73 6f 72 20 6c | 6f 63 61 74 69 6f 6e 20 |cursor l|ocation |
|00001530| 66 72 6f 6d 20 74 68 65 | 20 43 75 72 73 6f 72 20 |from the| Cursor |
|00001540| 64 61 74 61 0d 09 09 2a | 63 75 72 72 65 6e 74 50 |data...*|currentP|
|00001550| 6f 69 6e 74 20 3d 20 66 | 69 72 73 74 4d 6f 75 73 |oint = f|irstMous|
|00001560| 65 2d 3e 77 68 69 63 68 | 43 75 72 73 6f 72 2d 3e |e->which|Cursor->|
|00001570| 77 68 65 72 65 3b 0d 09 | 7d 20 65 6c 73 65 20 7b |where;..|} else {|
|00001580| 0d 09 09 2f 2f 20 4e 6f | 20 43 44 4d 20 73 6f 20 |...// No| CDM so |
|00001590| 77 65 20 75 73 65 20 74 | 68 65 20 6c 6f 77 20 6d |we use t|he low m|
|000015a0| 65 6d 6f 72 79 20 67 6c | 6f 62 61 6c 0d 09 09 2a |emory gl|obal...*|
|000015b0| 63 75 72 72 65 6e 74 50 | 6f 69 6e 74 20 3d 20 2a |currentP|oint = *|
|000015c0| 28 50 6f 69 6e 74 20 2a | 29 78 52 61 77 4d 6f 75 |(Point *|)xRawMou|
|000015d0| 73 65 3b 0d 09 7d 0d 7d | 0d 0d 76 6f 69 64 20 53 |se;..}.}|..void S|
|000015e0| 65 74 4d 6f 75 73 65 44 | 65 76 69 63 65 50 6f 73 |etMouseD|evicePos|
|000015f0| 69 74 69 6f 6e 28 50 6f | 69 6e 74 20 6e 65 77 50 |ition(Po|int newP|
|00001600| 6f 69 6e 74 29 0d 7b 0d | 09 2f 2f 20 54 68 69 73 |oint).{.|.// This|
|00001610| 20 72 6f 75 74 69 6e 65 | 20 73 65 74 73 20 74 68 | routine| sets th|
|00001620| 65 20 6d 6f 75 73 65 20 | 70 6f 73 69 74 69 6f 6e |e mouse |position|
|00001630| 20 74 6f 20 74 68 65 20 | 70 61 73 73 65 64 20 70 | to the |passed p|
|00001640| 6f 69 6e 74 0d 09 43 75 | 72 73 6f 72 44 65 76 69 |oint..Cu|rsorDevi|
|00001650| 63 65 20 2a 66 69 72 73 | 74 4d 6f 75 73 65 3b 0d |ce *firs|tMouse;.|
|00001660| 0d 09 69 66 20 28 54 72 | 61 70 41 76 61 69 6c 61 |..if (Tr|apAvaila|
|00001670| 62 6c 65 28 5f 43 75 72 | 73 6f 72 44 65 76 69 63 |ble(_Cur|sorDevic|
|00001680| 65 44 69 73 70 61 74 63 | 68 29 29 20 7b 20 0d 09 |eDispatc|h)) { ..|
|00001690| 09 2f 2f 20 49 66 20 77 | 65 20 67 65 74 20 68 65 |.// If w|e get he|
|000016a0| 72 65 20 77 65 20 68 61 | 76 65 20 74 68 65 20 43 |re we ha|ve the C|
|000016b0| 44 4d 0d 09 09 66 69 72 | 73 74 4d 6f 75 73 65 20 |DM...fir|stMouse |
|000016c0| 3d 20 4e 55 4c 4c 3b 09 | 2f 2f 20 73 74 61 72 74 |= NULL;.|// start|
|000016d0| 20 61 74 20 68 65 61 64 | 20 6f 66 20 63 75 72 73 | at head| of curs|
|000016e0| 6f 72 20 64 65 76 20 6c | 69 73 74 0d 09 09 43 75 |or dev l|ist...Cu|
|000016f0| 72 73 6f 72 44 65 76 69 | 63 65 4e 65 78 74 44 65 |rsorDevi|ceNextDe|
|00001700| 76 69 63 65 28 26 66 69 | 72 73 74 4d 6f 75 73 65 |vice(&fi|rstMouse|
|00001710| 29 3b 20 2f 2f 20 67 65 | 74 20 74 68 65 20 6e 65 |); // ge|t the ne|
|00001720| 78 74 20 63 75 72 73 6f | 72 20 64 65 76 69 63 65 |xt curso|r device|
|00001730| 0d 09 09 2f 2f 20 43 61 | 6c 6c 20 43 44 4d 20 74 |...// Ca|ll CDM t|
|00001740| 6f 20 6d 6f 76 65 20 74 | 68 65 20 6d 6f 75 73 65 |o move t|he mouse|
|00001750| 0d 09 09 43 75 72 73 6f | 72 44 65 76 69 63 65 4d |...Curso|rDeviceM|
|00001760| 6f 76 65 54 6f 28 66 69 | 72 73 74 4d 6f 75 73 65 |oveTo(fi|rstMouse|
|00001770| 2c 28 6c 6f 6e 67 29 6e | 65 77 50 6f 69 6e 74 2e |,(long)n|ewPoint.|
|00001780| 68 2c 28 6c 6f 6e 67 29 | 6e 65 77 50 6f 69 6e 74 |h,(long)|newPoint|
|00001790| 2e 76 29 3b 0d 09 7d 20 | 65 6c 73 65 20 7b 0d 09 |.v);..} |else {..|
|000017a0| 09 2f 2f 20 4e 6f 20 43 | 44 4d 20 73 6f 20 77 65 |.// No C|DM so we|
|000017b0| 20 75 73 65 20 74 68 65 | 20 6c 6f 77 20 6d 65 6d | use the| low mem|
|000017c0| 6f 72 79 20 67 6c 6f 62 | 61 6c 73 0d 09 09 2a 28 |ory glob|als...*(|
|000017d0| 50 6f 69 6e 74 20 2a 29 | 78 52 61 77 4d 6f 75 73 |Point *)|xRawMous|
|000017e0| 65 20 3d 20 6e 65 77 50 | 6f 69 6e 74 3b 0d 09 09 |e = newP|oint;...|
|000017f0| 2a 28 50 6f 69 6e 74 20 | 2a 29 78 4d 54 65 6d 70 |*(Point |*)xMTemp|
|00001800| 20 3d 20 6e 65 77 50 6f | 69 6e 74 3b 0d 09 09 2a | = newPo|int;...*|
|00001810| 28 50 74 72 29 78 43 72 | 73 72 4e 65 77 20 3d 20 |(Ptr)xCr|srNew = |
|00001820| 2a 28 50 74 72 29 78 43 | 72 73 72 43 6f 75 70 6c |*(Ptr)xC|rsrCoupl|
|00001830| 65 3b 20 2f 2f 20 53 65 | 74 20 43 72 73 72 4e 65 |e; // Se|t CrsrNe|
|00001840| 77 20 69 66 20 63 6f 75 | 70 6c 65 64 0d 09 09 43 |w if cou|pled...C|
|00001850| 61 6c 6c 43 75 72 73 6f | 72 54 61 73 6b 28 29 3b |allCurso|rTask();|
|00001860| 09 2f 2f 20 6d 75 73 74 | 20 63 61 6c 6c 20 6a 43 |.// must| call jC|
|00001870| 72 73 72 54 61 73 6b 20 | 74 6f 20 75 70 64 61 74 |rsrTask |to updat|
|00001880| 65 20 73 79 73 74 65 6d | 0d 09 7d 0d 7d 0d 0d 76 |e system|..}.}..v|
|00001890| 6f 69 64 20 53 65 74 4d | 6f 75 73 65 44 65 76 69 |oid SetM|ouseDevi|
|000018a0| 63 65 50 6f 73 69 74 69 | 6f 6e 52 65 6c 28 50 6f |cePositi|onRel(Po|
|000018b0| 69 6e 74 20 6e 65 77 50 | 6f 69 6e 74 29 0d 7b 0d |int newP|oint).{.|
|000018c0| 09 2f 2f 20 41 64 64 73 | 20 74 68 65 20 70 61 73 |.// Adds| the pas|
|000018d0| 73 65 64 20 70 6f 69 6e | 74 20 74 6f 20 74 68 65 |sed poin|t to the|
|000018e0| 20 63 75 72 72 65 6e 74 | 20 6d 6f 75 73 65 20 6c | current| mouse l|
|000018f0| 6f 63 61 74 69 6f 6e 0d | 09 43 75 72 73 6f 72 44 |ocation.|.CursorD|
|00001900| 65 76 69 63 65 20 2a 66 | 69 72 73 74 4d 6f 75 73 |evice *f|irstMous|
|00001910| 65 3b 0d 09 50 6f 69 6e | 74 20 74 65 6d 70 50 74 |e;..Poin|t tempPt|
|00001920| 3b 0d 09 69 66 20 28 54 | 72 61 70 41 76 61 69 6c |;..if (T|rapAvail|
|00001930| 61 62 6c 65 28 5f 43 75 | 72 73 6f 72 44 65 76 69 |able(_Cu|rsorDevi|
|00001940| 63 65 44 69 73 70 61 74 | 63 68 29 29 20 7b 20 0d |ceDispat|ch)) { .|
|00001950| 09 09 2f 2f 20 49 66 20 | 77 65 20 67 65 74 20 68 |..// If |we get h|
|00001960| 65 72 65 20 77 65 20 68 | 61 76 65 20 74 68 65 20 |ere we h|ave the |
|00001970| 43 44 4d 0d 09 09 66 69 | 72 73 74 4d 6f 75 73 65 |CDM...fi|rstMouse|
|00001980| 20 3d 20 4e 55 4c 4c 3b | 09 2f 2f 20 73 74 61 72 | = NULL;|.// star|
|00001990| 74 20 61 74 20 68 65 61 | 64 20 6f 66 20 63 75 72 |t at hea|d of cur|
|000019a0| 73 6f 72 20 64 65 76 20 | 6c 69 73 74 0d 09 09 43 |sor dev |list...C|
|000019b0| 75 72 73 6f 72 44 65 76 | 69 63 65 4e 65 78 74 44 |ursorDev|iceNextD|
|000019c0| 65 76 69 63 65 28 26 66 | 69 72 73 74 4d 6f 75 73 |evice(&f|irstMous|
|000019d0| 65 29 3b 09 2f 2f 20 67 | 65 74 20 74 68 65 20 6e |e);.// g|et the n|
|000019e0| 65 78 74 20 63 75 72 73 | 6f 72 20 64 65 76 69 63 |ext curs|or devic|
|000019f0| 65 0d 09 09 2f 2f 20 43 | 61 6c 6c 20 43 44 4d 20 |e...// C|all CDM |
|00001a00| 74 6f 20 6d 6f 76 65 20 | 74 68 65 20 6d 6f 75 73 |to move |the mous|
|00001a10| 65 20 72 65 6c 61 74 69 | 76 65 0d 09 09 43 75 72 |e relati|ve...Cur|
|00001a20| 73 6f 72 44 65 76 69 63 | 65 4d 6f 76 65 28 66 69 |sorDevic|eMove(fi|
|00001a30| 72 73 74 4d 6f 75 73 65 | 2c 28 6c 6f 6e 67 29 6e |rstMouse|,(long)n|
|00001a40| 65 77 50 6f 69 6e 74 2e | 68 2c 28 6c 6f 6e 67 29 |ewPoint.|h,(long)|
|00001a50| 6e 65 77 50 6f 69 6e 74 | 2e 76 29 3b 0d 09 7d 20 |newPoint|.v);..} |
|00001a60| 65 6c 73 65 20 7b 0d 09 | 09 2f 2f 20 4e 6f 20 43 |else {..|.// No C|
|00001a70| 44 4d 20 73 6f 20 77 65 | 20 75 73 65 20 74 68 65 |DM so we| use the|
|00001a80| 20 6c 6f 77 20 6d 65 6d | 6f 72 79 20 67 6c 6f 62 | low mem|ory glob|
|00001a90| 61 6c 73 0d 09 09 74 65 | 6d 70 50 74 20 3d 20 2a |als...te|mpPt = *|
|00001aa0| 28 50 6f 69 6e 74 20 2a | 29 78 52 61 77 4d 6f 75 |(Point *|)xRawMou|
|00001ab0| 73 65 3b 0d 09 09 74 65 | 6d 70 50 74 2e 68 20 2b |se;...te|mpPt.h +|
|00001ac0| 3d 20 6e 65 77 50 6f 69 | 6e 74 2e 68 3b 0d 09 09 |= newPoi|nt.h;...|
|00001ad0| 74 65 6d 70 50 74 2e 76 | 20 2b 3d 20 6e 65 77 50 |tempPt.v| += newP|
|00001ae0| 6f 69 6e 74 2e 76 3b 0d | 09 09 2a 28 50 6f 69 6e |oint.v;.|..*(Poin|
|00001af0| 74 20 2a 29 78 52 61 77 | 4d 6f 75 73 65 20 3d 20 |t *)xRaw|Mouse = |
|00001b00| 74 65 6d 70 50 74 3b 0d | 09 09 2a 28 50 6f 69 6e |tempPt;.|..*(Poin|
|00001b10| 74 20 2a 29 78 4d 54 65 | 6d 70 20 3d 20 74 65 6d |t *)xMTe|mp = tem|
|00001b20| 70 50 74 3b 0d 09 09 2a | 28 50 74 72 29 78 43 72 |pPt;...*|(Ptr)xCr|
|00001b30| 73 72 4e 65 77 20 3d 20 | 2a 28 50 74 72 29 78 43 |srNew = |*(Ptr)xC|
|00001b40| 72 73 72 43 6f 75 70 6c | 65 3b 0d 09 09 43 61 6c |rsrCoupl|e;...Cal|
|00001b50| 6c 43 75 72 73 6f 72 54 | 61 73 6b 28 29 3b 0d 09 |lCursorT|ask();..|
|00001b60| 7d 0d 7d 20 0d 09 0d 76 | 6f 69 64 20 46 75 64 67 |}.} ...v|oid Fudg|
|00001b70| 65 43 75 72 73 6f 72 28 | 76 6f 69 64 29 0d 7b 0d |eCursor(|void).{.|
|00001b80| 2f 2f 20 4e 6f 77 20 68 | 65 72 65 20 69 73 20 61 |// Now h|ere is a|
|00001b90| 20 72 6f 75 74 69 6e 65 | 20 74 68 61 74 20 79 6f | routine| that yo|
|00001ba0| 75 20 63 61 6e 20 64 72 | 6f 70 20 69 6e 74 6f 20 |u can dr|op into |
|00001bb0| 74 68 65 20 74 72 61 66 | 66 69 63 20 6c 69 67 68 |the traf|fic ligh|
|00001bc0| 74 20 73 61 6d 70 6c 65 | 20 74 68 61 74 0d 2f 2f |t sample| that.//|
|00001bd0| 20 63 61 6e 20 62 65 20 | 63 61 6c 6c 65 64 20 74 | can be |called t|
|00001be0| 6f 20 73 6c 6f 77 6c 79 | 20 6d 6f 76 65 20 74 68 |o slowly| move th|
|00001bf0| 65 20 6d 6f 75 73 65 20 | 74 6f 20 74 68 65 20 6c |e mouse |to the l|
|00001c00| 6f 77 65 72 20 72 69 67 | 68 74 20 68 61 6e 64 20 |ower rig|ht hand |
|00001c10| 63 6f 72 6e 65 72 20 6f | 66 20 0d 2f 2f 20 74 68 |corner o|f .// th|
|00001c20| 65 20 73 63 72 65 65 6e | 20 69 74 20 65 78 69 74 |e screen| it exit|
|00001c30| 73 20 77 68 65 6e 20 74 | 68 65 20 6d 6f 75 73 65 |s when t|he mouse|
|00001c40| 20 62 75 74 74 6f 6e 20 | 69 73 20 68 65 6c 64 20 | button |is held |
|00001c50| 64 6f 77 6e 0d 0d 09 50 | 6f 69 6e 74 20 52 61 6e |down...P|oint Ran|
|00001c60| 64 50 74 3b 0d 09 6c 6f | 6e 67 20 66 72 65 64 3b |dPt;..lo|ng fred;|
|00001c70| 0d 0d 09 47 65 74 4d 6f | 75 73 65 44 65 76 69 63 |...GetMo|useDevic|
|00001c80| 65 50 6f 73 69 74 69 6f | 6e 28 26 52 61 6e 64 50 |ePositio|n(&RandP|
|00001c90| 74 29 3b 0d 09 64 6f 20 | 7b 0d 09 52 61 6e 64 50 |t);..do |{..RandP|
|00001ca0| 74 2e 68 20 2b 3d 20 31 | 3b 20 2f 2f 20 42 75 6d |t.h += 1|; // Bum|
|00001cb0| 70 20 74 6f 20 74 68 65 | 20 6e 65 78 74 20 70 69 |p to the| next pi|
|00001cc0| 78 65 6c 20 61 63 72 6f | 73 73 0d 09 52 61 6e 64 |xel acro|ss..Rand|
|00001cd0| 50 74 2e 76 20 2b 3d 20 | 31 3b 20 2f 2f 20 42 75 |Pt.v += |1; // Bu|
|00001ce0| 6d 70 20 74 6f 20 74 68 | 65 20 6e 65 78 74 20 70 |mp to th|e next p|
|00001cf0| 69 78 65 6c 20 64 6f 77 | 6e 0d 09 0d 09 53 65 74 |ixel dow|n....Set|
|00001d00| 4d 6f 75 73 65 44 65 76 | 69 63 65 50 6f 73 69 74 |MouseDev|icePosit|
|00001d10| 69 6f 6e 28 52 61 6e 64 | 50 74 29 3b 20 2f 2f 20 |ion(Rand|Pt); // |
|00001d20| 6d 6f 76 65 20 61 62 73 | 6f 6c 75 74 65 0d 09 0d |move abs|olute...|
|00001d30| 09 44 65 6c 61 79 28 31 | 30 2c 26 66 72 65 64 29 |.Delay(1|0,&fred)|
|00001d40| 3b 20 2f 2f 20 77 61 69 | 74 20 31 30 20 74 69 63 |; // wai|t 10 tic|
|00001d50| 6b 73 20 66 6f 72 20 73 | 6d 6f 6f 74 68 20 64 72 |ks for s|mooth dr|
|00001d60| 61 77 69 6e 67 0d 09 7d | 20 77 68 69 6c 65 20 28 |awing..}| while (|
|00001d70| 21 42 75 74 74 6f 6e 28 | 29 29 3b 20 2f 2f 20 71 |!Button(|)); // q|
|00001d80| 75 69 74 20 77 68 65 6e | 20 74 68 65 20 62 75 74 |uit when| the but|
|00001d90| 74 6f 6e 20 69 73 20 64 | 6f 77 6e 2e 0d 7d 0d 00 |ton is d|own..}..|
|00001da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e00| 00 00 01 00 00 00 01 90 | 00 00 00 90 00 00 00 66 |........|.......f|
|00001e10| 04 4c 00 03 96 e2 00 65 | 9d 8c f0 30 ff ff 08 00 |.L.....e|...0....|
|00001e20| 00 27 00 00 00 00 f0 31 | 00 00 00 00 00 31 00 00 |.'.....1|.....1..|
|00001e30| 0b 4d 6f 76 65 4d 6f 75 | 73 65 2e 63 02 00 00 00 |.MoveMou|se.c....|
|00001e40| 50 61 72 74 53 49 54 21 | 00 00 00 00 00 00 00 00 |PartSIT!|........|
|00001e50| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|00001e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001e70| 00 00 ab bf ee 66 00 00 | 00 00 00 00 01 f6 00 00 |.....f..|........|
|00001e80| 00 c1 00 00 00 00 f0 39 | 00 59 00 00 03 31 00 00 |.......9|.Y...1..|
|00001e90| 00 00 f0 38 00 5f 00 00 | 03 55 00 00 00 00 f0 3b |...8._..|.U.....;|
|00001ea0| 00 72 00 00 04 c1 00 00 | 00 00 f0 37 ff ff 00 00 |.r......|...7....|
|00001eb0| 04 9e 00 00 00 00 f0 33 | 01 1c 00 00 00 e4 00 00 |.......3|........|
|00001ec0| 00 00 f0 22 01 79 00 00 | 55 0e 00 00 00 00 f0 21 |...".y..|U......!|
|00001ed0| 01 85 00 00 56 12 00 00 | 00 00 f0 36 02 46 20 00 |....V...|...6.F .|
|00001ee0| 96 e9 00 00 00 00 f0 3a | 02 a0 00 00 05 ce 00 00 |.......:|........|
|00001ef0| 00 00 f0 35 04 35 20 03 | 96 a3 00 65 9d 9c f0 3e |...5.5 .|...e...>|
|00001f00| 00 00 00 16 00 01 00 00 | 00 00 00 10 00 0c 00 01 |........|........|
|00001f10| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 1e 00 2a |........|.......*|
|00001f20| 00 03 01 81 01 ff 00 2a | 00 03 01 6b 01 3a 00 00 |.......*|...k.:..|
|00001f30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 04 |........|........|
|00001f40| 00 01 00 01 00 00 00 48 | 00 09 4d 6f 6e 61 63 6f |.......H|..Monaco|
|00001f50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001f60| 00 00 00 00 00 00 00 00 | 00 00 00 06 00 04 00 2a |........|.......*|
|00001f70| 00 03 02 6d 03 3d 00 3c | 00 04 01 8c 02 7e ab 39 |...m.=.<|.....~.9|
|00001f80| ec f0 00 00 0e ec 00 00 | 0e ec 00 00 00 00 00 00 |........|........|
|00001f90| 00 00 01 00 00 00 01 90 | 00 00 00 90 00 00 00 66 |........|.......f|
|00001fa0| 01 ab cc 00 23 fe 00 00 | 00 1c 00 66 00 02 73 74 |....#...|...f..st|
|00001fb0| 79 6c 00 00 00 1a 4d 50 | 53 52 00 01 00 26 4d 57 |yl....MP|SR...&MW|
|00001fc0| 42 42 00 00 00 3e 00 80 | ff ff 00 00 00 00 00 00 |BB...>..|........|
|00001fd0| 00 00 03 f0 ff ff 00 00 | 00 1a 00 00 00 00 03 ed |........|........|
|00001fe0| ff ff 00 00 00 44 01 ab | cf 0c 03 f0 ff ff 00 00 |.....D..|........|
|00001ff0| 00 3c 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.<......|........|
+--------+-------------------------+-------------------------+--------+--------+